home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-11-11 | 5.4 KB | 278 lines | [TEXT/MPS ] |
- ;
- ; File: Events.a
- ;
- ; Copyright: © 1984-1994 by Apple Computer, Inc.
- ; All rights reserved.
- ;
- ; Version: Universal Interfaces 2.0a3 ETO #16, MPW prerelease. Friday, November 11, 1994.
- ;
- ; Bugs?: If you find a problem with this file, send the file and version
- ; information (from above) and the problem description to:
- ;
- ; Internet: apple.bugs@applelink.apple.com
- ; AppleLink: APPLE.BUGS
- ;
- ;
-
- IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
- __EVENTS__ SET 1
-
-
- IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
- include 'Types.a'
- ENDIF
- ; include 'ConditionalMacros.a' ;
-
- IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
- include 'Quickdraw.a'
- ENDIF
- ; include 'MixedMode.a' ;
- ; include 'QuickdrawText.a' ;
-
- IF &TYPE('__OSUTILS__') = 'UNDEFINED' THEN
- include 'OSUtils.a'
- ENDIF
- ; include 'Memory.a' ;
-
- nullEvent EQU 0
- mouseDown EQU 1
- mouseUp EQU 2
- keyDown EQU 3
- keyUp EQU 4
- autoKey EQU 5
- updateEvt EQU 6
- diskEvt EQU 7
- activateEvt EQU 8
- osEvt EQU 15
- ; event mask equates
- mDownMask EQU $0002 ; mouse button pressed
- mUpMask EQU $0004 ; mouse button released
- keyDownMask EQU $0008 ; key pressed
- keyUpMask EQU $0010 ; key released
- autoKeyMask EQU $0020 ; key repeatedly held down
- updateMask EQU $0040 ; window needs updating
- diskMask EQU $0080 ; disk inserted
- activMask EQU $0100 ; activate/deactivate window
- highLevelEventMask EQU $0400 ; high-level events (includes AppleEvents)
- osMask EQU $8000 ; operating system events (suspend, resume)
- everyEvent EQU $FFFF ; all of the above
-
- ; event message equates
- charCodeMask EQU $000000FF
- keyCodeMask EQU $0000FF00
- adbAddrMask EQU $00FF0000
- osEvtMessageMask EQU $FF000000
- ; OS event messages. Event (sub)code is in the high byte of the message field.
- mouseMovedMessage EQU $00FA
- suspendResumeMessage EQU $0001
- resumeFlag EQU 1 ; Bit 0 of message indicates resume vs suspend
- convertClipboardFlag EQU 2 ; Bit 1 in resume message indicates clipboard change
- ; modifiers
- activeFlag EQU $0001 ; Bit 0 of modifiers for activateEvt and mouseDown events
- btnState EQU $0080 ; Bit 7 of low byte is mouse button state
- cmdKey EQU $0100 ; Bit 0 of high byte
- shiftKey EQU $0200 ; Bit 1 of high byte
- alphaLock EQU $0400 ; Bit 2 of high byte
- optionKey EQU $0800 ; Bit 3 of high byte
- controlKey EQU $1000 ; Bit 4 of high byte
- ; obsolete equates
- networkEvt EQU 10
- driverEvt EQU 11
- app1Evt EQU 12
- app2Evt EQU 13
-
- app3Evt EQU 14
- app4Evt EQU 15
- networkMask EQU $0400
- driverMask EQU $0800
- app1Mask EQU $1000
- app2Mask EQU $2000
- app3Mask EQU $4000
- app4Mask EQU $8000
-
- EventRecord RECORD 0
- what ds.w 1
- message ds.l 1
- when ds.l 1
- where ds Point
- modifiers ds.w 1
- sizeof EQU 16
- ENDR
-
- EvQEl RECORD 0
- qLink ds.l 1
- qType ds.w 1
- evtQWhat ds.w 1 ; this part is identical to the EventRecord as...
- evtQMessage ds.l 1 ; defined in ToolIntf
- evtQWhen ds.l 1
- evtQWhere ds Point
- evtQModifiers ds.w 1
- sizeof EQU 22
- ENDR
-
- IF GENERATING68K THEN
- Macro
- GetDblTime
- move.L $02F0,(sp)
- EndM
- ELSE
- IMPORT GetDblTime
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- GetCaretTime
- move.L $02F4,(sp)
- EndM
- ELSE
- IMPORT GetCaretTime
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- SetEventMask
- move.W (sp)+,$0144
- EndM
- ELSE
- IMPORT SetEventMask
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetEventQueue
- dc.w $2EBC
- dc.w $0000
- dc.w $014A
- EndM
- ELSE
- IMPORT GetEventQueue
- ENDIF
-
- IF GENERATING68K THEN
- _GetNextEvent: OPWORD $A970
- ELSE
- IMPORT GetNextEvent
- ENDIF
-
- IF GENERATING68K THEN
- _WaitNextEvent: OPWORD $A860
- ELSE
- IMPORT WaitNextEvent
- ENDIF
-
- IF GENERATING68K THEN
- _EventAvail: OPWORD $A971
- ELSE
- IMPORT EventAvail
- ENDIF
-
- IF GENERATING68K THEN
- _GetMouse: OPWORD $A972
- ELSE
- IMPORT GetMouse
- ENDIF
-
- IF GENERATING68K THEN
- _Button: OPWORD $A974
- ELSE
- IMPORT Button
- ENDIF
-
- IF GENERATING68K THEN
- _StillDown: OPWORD $A973
- ELSE
- IMPORT StillDown
- ENDIF
-
- IF GENERATING68K THEN
- _WaitMouseUp: OPWORD $A977
- ELSE
- IMPORT WaitMouseUp
- ENDIF
-
- IF GENERATING68K THEN
- _GetKeys: OPWORD $A976
- ELSE
- IMPORT GetKeys
- ENDIF
-
- IF GENERATING68K THEN
- _KeyTranslate: OPWORD $A9C3
- ELSE
- IMPORT KeyTranslate
- ENDIF
-
- IF GENERATING68K THEN
- _TickCount: OPWORD $A975
- ELSE
- IMPORT TickCount
- ENDIF
-
- IF GENERATING68K THEN
- _PostEvent: OPWORD $A02F
- ELSE
- IMPORT PostEvent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _PPostEvent
- dc.w $A12F
- dc.w $2288
- EndM
- ELSE
- IMPORT PPostEvent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _OSEventAvail
- dc.w $A030
- dc.w $5240
- EndM
- ELSE
- IMPORT OSEventAvail
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _GetOSEvent
- dc.w $A031
- dc.w $5240
- EndM
- ELSE
- IMPORT GetOSEvent
- ENDIF
-
- IF GENERATING68K THEN
- Macro
- _FlushEvents
- dc.w $201F
- dc.w $A032
- EndM
- ELSE
- IMPORT FlushEvents
- ENDIF
-
- IF GENERATING68K THEN
- _SystemClick: OPWORD $A9B3
- ELSE
- IMPORT SystemClick
- ENDIF
-
- IF GENERATING68K THEN
- _SystemTask: OPWORD $A9B4
- ELSE
- IMPORT SystemTask
- ENDIF
-
- IF GENERATING68K THEN
- _SystemEvent: OPWORD $A9B2
- ELSE
- IMPORT SystemEvent
- ENDIF
-
- IF OLDROUTINENAMES THEN
- ENDIF
- ENDIF ; __EVENTS__
-